package com.amap.search.task;

import com.amap.search.service.ElasticSearchOperatorService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 每分钟将内存中的数据放入es
 */
@Service
@Slf4j
public class PushCacheToEs {
    @Resource
    private ElasticSearchOperatorService elasticSearchOperatorService;

    @Scheduled(cron = "0 * * * * ?")
    public void runJob(){
        elasticSearchOperatorService.pushElement();
        log.info("[PushCacheToEs] push success!");
    }
}
